/*
 *  File.h
 *  pcm
 *
 *  Created by Yanick Candaux on 15.12.11.
 *  Copyright 2011 Heig-vd. All rights reserved.
 *
 */



#ifndef FILE_H_
#define FILE_H_

#include "BoardInfos.hpp"
#include "Node.h"
#include <cstring>
//#include <stm/config.h>
#include <stdint.h>
#include <limits.h>


#define cas32(p, o, n)      __sync_val_compare_and_swap(p, o, n)
#define cas64(p, o, n)      __sync_val_compare_and_swap(p, o, n)
#define casptr(p, o, n)     __sync_val_compare_and_swap(p, o, n)
#define bcas32(p, o, n)     __sync_bool_compare_and_swap(p, o, n)
#define bcas64(p, o, n)     __sync_bool_compare_and_swap(p, o, n)
#define bcasptr(p, o, n)    __sync_bool_compare_and_swap(p, o, n)

using namespace std;

namespace pcm {
	
class File {
	
	
		
	
public:
	

	
	Node *Head;
	Node *Tail;
	
	bool initializeQueue();
	bool enq(BoardInfos *value);
	BoardInfos *deq();
	void freeNode(Node *node);
	Node *getFreeNode();

	
protected:
	
	
	
	
private:

};
}
#endif /* FILE_H_ */
